//
//  UIView+BLShadowView.m
//  BLForeign
//
//  Created by gaoguangxiao on 2022/9/5.
//  Copyright © 2022 高广校. All rights reserved.
//

#import "UIView+BLShadowView.h"

@implementation UIView (BLShadowView)


- (void)setShadow {
    self.layer.masksToBounds = NO;
    self.layer.shadowColor = K_RGBColor(230, 230, 230).CGColor;
    self.layer.shadowRadius = 5;
    self.layer.shadowOffset = CGSizeZero;
    self.layer.shadowOpacity = 1;
}

- (void)setBotttomShadow {
    self.layer.masksToBounds = NO;
    self.layer.shadowColor = K_RGBColor(225, 225, 225).CGColor;
    self.layer.shadowRadius = 5;
    self.layer.shadowOffset = CGSizeMake(0, 3);
    self.layer.shadowOpacity = 1;
}

- (void)setBotttomShadowNormal {
    self.layer.cornerRadius = 15;
    self.layer.shadowColor = [UIColor colorWithRed:128/255.0 green:88/255.0 blue:59/255.0 alpha:0.1200].CGColor;
    self.layer.shadowOffset = CGSizeMake(0,1.5);
    self.layer.shadowOpacity = 1;
    self.layer.shadowRadius = 9;
}

- (void)deleteBotttomShadow {
    self.layer.masksToBounds = NO;
    self.layer.shadowColor = [UIColor clearColor].CGColor;
    self.layer.shadowRadius = 0;
    self.layer.shadowOffset = CGSizeMake(0, 0);
    self.layer.shadowOpacity = 1;
}

- (void)yx_generateCorners:(CGRect)bounds cornerRadii:(CGSize)cornerRadii rectCorner:(UIRectCorner)rectCorner {
    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:bounds
                                               byRoundingCorners:rectCorner
                                                     cornerRadii:cornerRadii];
    CAShapeLayer *shapeLayer = [CAShapeLayer layer];
    shapeLayer.frame = bounds;
    shapeLayer.path = path.CGPath;
    shapeLayer.backgroundColor = [UIColor lightGrayColor].CGColor;
    self.layer.mask = shapeLayer;
}
@end
